__author__ = 'dracher'
import os
import shutil
from public_parameters import TEST_MATERIAL_PATH, ROOT_PATH

ticketPath = os.path.join(TEST_MATERIAL_PATH, "Tickets")



def renameXMLToTXT():
    for a, b, c in os.walk(ticketPath):
        for file in c:
            if file.endswith("xml") or file.endswith("XML"):
                shutil.move(os.path.join(a, file),
                            os.path.join(a, file.split(".")[0]+".txt"))

def listAllNoTxt():
    for a, b, c in os.walk(ticketPath):
        for file in c:
            if not file.endswith("txt"):
                print file

def log_progress(message=None):
    if message:
        with open(os.path.join(ROOT_PATH, '.progress'), 'w') as fp:
            fp.write(message)
    else:
        with open(os.path.join(ROOT_PATH, '.progress'), 'r') as fp:
            return fp.read()

if __name__ == "__main__":
    listAllNoTxt()